//
// Created by 成飞 on 2024/1/8.
//

#ifndef ORDERKV_RECORDVAL_H
#define ORDERKV_RECORDVAL_H


#include <cstdio>
#include <ostream>
#include "db/meta_data.h"

namespace lsm{

    struct LsmRecordVal{
        meta::fid fileNo;
        meta::f_off recordOffset;
        meta::f_off recordLen;

        friend std::ostream& operator<<(std::ostream& os, const LsmRecordVal& record) {
            os << "{ fid: " << record.fileNo << " off: " << record.recordOffset << " len: " << record.recordLen << " }";
            return os;
        }

        friend std::ofstream& operator<<(std::ofstream& ofs, const LsmRecordVal& record) {
            ofs << record.fileNo << std::endl
                << record.recordOffset << std::endl
                << record.recordLen << std::endl;
            return ofs;
        }
    };

    struct ScanInfo{
        meta::f_off startOff;
        meta::f_off endOff;
    };
}

#endif //ORDERKV_RECORDVAL_H
